<?php
$nome = "Ronaldo Teste";
$telefone = "Telefone Teste";
$email = "ronaldoqj@gmail.com";
$duvidas = "Envio com Variavel";

// ------  CORPO DO EMAIL  --------------
$corpo = '<table>';

if( $nome != "" ){
	$corpo .= '<tr><td width="500" bgcolor="#CCCCCC"><b> Nome  </b> : </td></tr>';
	$corpo .= '<tr><td width="500" bgcolor="#E0E0E0">' . $nome . '</td></tr>';
	$corpo .= '<tr><td width="500" bgcolor="#FFFFFF"></td></tr>';
}
if( $telefone != "" ){
	$corpo .= '<tr><td width="500" bgcolor="#CCCCCC"><b> Telefone  </b> : </td></tr>';
	$corpo .= '<tr><td width="500" bgcolor="#E0E0E0">' . $telefone . '</td></tr>';
	$corpo .= '<tr><td width="500" bgcolor="#FFFFFF"></td></tr>';
}
if( $email != "" ){
	$corpo .= '<tr><td width="500" bgcolor="#CCCCCC"><b> E-mail  </b> : </td></tr>';
	$corpo .= '<tr><td width="500" bgcolor="#E0E0E0">' . $email . '</td></tr>';
	$corpo .= '<tr><td width="500" bgcolor="#FFFFFF"></td></tr>';
}
if( $duvidas != "" ){
	$corpo .= '<tr><td width="500" bgcolor="#CCCCCC"><b> D&uacute;vidas  </b> : </td></tr>';
	$corpo .= '<tr><td width="500" bgcolor="#E0E0E0">' . $duvidas . '</td></tr>';
	$corpo .= '<tr><td width="500" bgcolor="#FFFFFF"></td></tr>';
}

$corpo .= '</table><br /><br />';
$corpo .= '</table>';
// --------------------------------------

	require_once('PHPMailer/class.phpmailer.php');
	$agora = date("d/m/y-H:m:s");
       
        $mail = new PHPMailer(true);         
        $mail->IsSMTP();   
		
        try {
			$mail->Host       = "smtp.minahjoias.com.br"; 
			$mail->Port       = 587;
			$mail->SMTPAuth   = true;   
			$mail->Username   = "site@minahjoias.com.br";  
			$mail->Password   = "site0102"; 
					
			$mail->From = $email;  
			$mail->FromName = utf8_decode($nome);		
			$mail->AddAddress($email, "Ronaldo");
			$mail->AddBCC("ronaldoqj@hotmail.com", "RO");
					
			$mail->Subject = "TesteEmail";                                  
			$mail->IsHTML(true);                                     
			$mail->Body = utf8_decode($corpo);                                

			$mail->Send();

            echo '<br /><br />E-Mail enviado com sucesso!';
        } catch (phpmailerException $e) {
				echo '<br /><br />ERRO ao enviar E-Mail!<br /><br />';
                echo $e->errorMessage();
        } catch (Exception $e) {
				echo '<br /><br />ERRO ao enviar E-Mail!<br /><br />';
                echo $e->getMessage();
        }
?>